package iot.wlink.network.devices.session;

import io.netty.channel.Channel;
import iot.wlink.network.devices.shadows.DeviceShadow;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author : willian fu
 * @date : 2021/8/20
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class SessionAndShadow {

    //回收计数引用，缓存3天，超过3天不上线则删除session， 如果有redis的话直接用redis实现好啦
    private int freeCount = 3600 * 24 * 3;

    //设备一些需要缓存的信息
    private DeviceSession session;

    //设备影子 有需要可以放redis
    private DeviceShadow shadow;

    //设备NIO连接，对于netty原生长连接对象
    private Channel channel;

    //设备当前是否在线
    private Boolean isOnline = false;
}
